<script>
	 // import routingIntercept from '@/router/index.js'
	 import useUserStore from '@/store/user.js'
	 
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			const userStore = useUserStore()
			const token = uni.getStorageSync('token'); // 获取本地存储的token值
			if (token) { // 如果token存在，则自动登录
                // 存在
				userStore.setToken(token); // 将token存储到pinia中
                // 自动登录逻辑...
				userStore.fillUser(uni.getStorageSync('userinfo'))
			}else{
				console.log('token不存在')
				
			} 
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	// /* @import "uview-plus/index.scss"; */
</style>